<?php

define('NUM_OF_PRODUCT',23);
define('COLS',2);

$rows = ceil(NUM_OF_PRODUCT/COLS);
$count = 1;
?>
<table border="1" align="center" width="80%">
<?php
  for($i=1  ; $i<=$rows ; $i++) {
    $color = ($i%2==0)?'yellow':'pink';
?>
  <tr>
    <?php
for($j=1  ; $j<=COLS ; $j++) {
  if($count<=NUM_OF_PRODUCT){
    ?>
    <td style="background:<?=$color?>">Item <?=$count++?></td>
<?php } else {// end if
?>
    <td style="background:<?=$color?>">&nbsp;</td>
<?php
      }
}// end inner for of <td>
?>
  </tr>
<?php
  }// end for
?>
</table>
